<% content_for :thredded_page_title, 'Theme Preview' %>
<% content_for :thredded_page_id, 'thredded--theme' %>
<% content_for :thredded_breadcrumbs do %>
  <ul class="thredded--navigation-breadcrumbs">
    <li><%= link_to 'Theme Preview', theme_preview_path %></li>
  </ul>
<% end %>

<%= thredded_page do %>
  <%= render 'section_title', label: 'messageboards#index', href: messageboards_path %>
  <%= content_tag :section, class: 'thredded--thredded--main-section thredded--messageboards' do %>
    <%= define_svg_icons('thredded/follow.svg', 'thredded/lock.svg') %>
    <div class="thredded--messageboards-group">
      <%= render partial: 'thredded/messageboards/messageboard', collection: @messageboard_views %>
    </div>
    <div class="thredded--messageboards--actions">
      <a class="thredded--button" href="<%= new_messageboard_path %>" rel="nofollow">
        <%= t 'thredded.messageboard.create' %>
      </a>
    </div>
  <% end %>


  <%= render 'section_title', label: 'topics#index', href: messageboard_topics_path(@messageboard) %>
  <%= content_tag :section, class: 'thredded--thredded--main-section topics' do %>
    <%= render 'thredded/topics/form',
               topic:        @new_topic,
               css_class:    'thredded--is-compact',
               placeholder:  t('thredded.topics.form.title_placeholder_start') %>
    <%= render @topics %>
  <% end %>
  <footer>
    <%= paginate @topics %>
  </footer>
  <br>


  <%= render 'section_title', label: 'topics#show', href: @topic.path %>
  <%= content_tag :section, id: dom_id(@topic), class: ['thredded--thredded--main-section', topic_css_classes(@topic)] do %>
    <%= render 'thredded/topics/header', topic: @topic %>
    <%= render @posts %>
    <%= render 'thredded/posts/form',
               post:         @new_post,
               button_text:  t('thredded.posts.form.create_btn')
    %>
  <% end %>

  <%= render 'section_title', label: 'topics#new', href: new_messageboard_topic_path(@messageboard) %>
  <%= render 'thredded/topics/form',
             topic:        @new_topic,
             placeholder:  t('thredded.topics.form.title_placeholder_start') %>

  <%= render 'section_title', label: 'posts#edit', href: edit_messageboard_topic_post_path(@messageboard, @post.postable, @post) %>
  <%= content_tag :section, class: 'thredded--thredded--main-section posts-form' do %>
    <h3 class="thredded--post-form--title"><%= t 'thredded.posts.edit' %></h3>

    <%= render 'thredded/posts/form',
               post:         @post_form,
               button_text:  t('thredded.posts.form.update_btn')
    %>
  <% end %>

  <%= render 'section_title', label: 'private_topics#index', href: private_topics_path %>
  <%= content_tag :section, class: 'thredded--thredded--main-section private-topics' do %>
    <p><em>If the user has no private topics:</em></p>
    <%= render 'thredded/private_topics/no_private_topics' %>

    <hr>

    <p><em>If the user has private topics:</em></p>
    <%= render 'thredded/private_topics/form',
               private_topic: @new_private_topic,
               css_class:     'thredded--is-compact',
               placeholder:   t('thredded.private_topics.form.title_placeholder_start') %>
    <%= render @private_topics %>
  <% end %>

  <%= render 'section_title', label: 'private_topics#new', href: new_private_topic_path %>
  <section class="thredded--thredded--main-section">
    <%= render 'thredded/private_topics/form',
               private_topic: @new_private_topic,
               placeholder:   t('thredded.private_topics.form.title_placeholder_new') %>
  </section>

  <%= render 'section_title', label: 'private_topics#show', href: private_topic_path(@private_topic) %>
  <section class="thredded--thredded--main-section">
    <%= render 'thredded/private_topics/header', topic: @private_topic %>
    <%= render partial: 'thredded/private_posts/private_post', collection: @private_posts %>
    <%= render 'thredded/private_posts/form',
               post:        @private_post_form,
               button_text: t('thredded.private_posts.form.create_btn')
    %>
  </section>

  <%= render 'section_title', label: 'preferences#edit', href: edit_messageboard_preferences_path(@messageboard) %>
  <%= content_tag :section, class: 'thredded--thredded--main-section preferences' do %>
    <h2 class="thredded--preferences-header--title"><%= t 'thredded.preferences.global_preferences_title' %></h2>
    <%= render 'thredded/preferences/form', preferences: @preferences %>
  <% end %>

  <%= render 'thredded/shared/currently_online' %>
<% end %>
